package cn.edu.zxj.trans.service;

import cn.edu.zxj.trans.mapper.UserMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created with IntelliJ IDEA.
 * Description：
 *
 * @author: zxj
 * @date: 2024-02-03
 * @time: 11:44:17
 */
@Slf4j
@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;

    public Integer insert(String userName, String password) {
        log.info("接收到向数据库插入 User 信息服务, userName: {}, password: {}",userName,password);
        try {
            return userMapper.insert(userName, password);
        } catch (Exception e) {
            log.error("插入用户信息失败, e: {}",e);
        }
        return -1;
    }

}
